﻿using System;
using ControleRepresentante.Migration.Repositories;

namespace ControleRepresentante.Migration.Steps
{
    class PedidoCalculationMigrateStep : IMigrationStep
    {
        public void Migrate(Guid representanteId, MigrationStatus migrationStatus, ControleRepresentanteRepository controleRepresentanteRepository, ZTRepository ztRepository, Guid userId)
        {
            migrationStatus.SetCurrentProgress(0, 4);

            migrationStatus.CurrentStep = "Calculate TotalMercadoria";
            controleRepresentanteRepository.CalculateTotalMercadoria();
            migrationStatus.SetCurrentProgress(1, 4);

            migrationStatus.CurrentStep = "Calculate TotalPecas";
            controleRepresentanteRepository.CalculateTotalPecas();
            migrationStatus.SetCurrentProgress(2, 4);

            migrationStatus.CurrentStep = "Valor Imposto";
            controleRepresentanteRepository.CalculateValorImposto();
            migrationStatus.SetCurrentProgress(3, 4);

            migrationStatus.CurrentStep = "Total Liquido";
            controleRepresentanteRepository.CalculateTotalLiquido();
            migrationStatus.SetCurrentProgress(4, 4);
        }
    }
}
